package com.example.zg3.login

import androidx.lifecycle.MutableLiveData
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.LoginBean
import com.example.base.mvvm.BaseViewModel
import com.example.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class LoginViewModel @Inject constructor(val  apiService: ApiService):BaseViewModel() {
    val success=MutableLiveData<LoginBean>()
    fun login(username:String,password:String){
        httpRequest({apiService.login(username,password)},success::postValue)
    }
}